wayland: fix testtooltips
authorOlivier Fourdan <ofourdan@redhat.com>
Fri, 4 Dec 2015 10:25:50 +0000 (11:25 +0100)
committerOlivier Fourdan <ofourdan@redhat.com>
Fri, 4 Dec 2015 12:17:29 +0000 (13:17 +0100)
On Wayland, for tooltips to work as expected, the type hint must be set
to tooltips, otherwise the popup window won't be translated as a
subsurface.

Fix the test do work as expected under Wayland.

Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=759018

tests/testtooltips.c

index 4e1552d69b03798e5dd201765e320437a73455ad..853239e97be9bd997f195541423ab4844bf00625 100644 (file)
@@ -341,6 +341,11 @@ main (int argc, char *argv[])
   gtk_widget_show (tooltip_button);
 
   gtk_widget_set_tooltip_window (button, GTK_WINDOW (tooltip_window));
+  gtk_window_set_type_hint (GTK_WINDOW (tooltip_window),
+                            GDK_WINDOW_TYPE_HINT_TOOLTIP);
+  gtk_window_set_transient_for (GTK_WINDOW (tooltip_window),
+                                GTK_WINDOW (window));
+
   g_signal_connect (button, "query-tooltip",
                    G_CALLBACK (query_tooltip_custom_cb), NULL);
   g_object_set (button, "has-tooltip", TRUE, NULL);